﻿namespace IceCS.DesignPattern.Core.DecoratorPattern.ShapeWrapper
{
    /// <summary>
    /// 图形装饰器
    /// </summary>
    public abstract class ShapeDecorator : IShapeAction
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="shape">要装饰的图形</param>
        protected ShapeDecorator(IShapeAction shape)
        {
            DecoratedShape = shape;
        }

        protected IShapeAction DecoratedShape { get; set; }

        /// <summary>
        /// 绘制图形
        /// </summary>
        public virtual void Draw()
        {
            //调用被装饰的图形的方法
            DecoratedShape.Draw();
        }
    }
}
